<?php

namespace App\Models;

use Hyn\Tenancy\Traits\UsesTenantConnection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Models\AssetBrand
 *
 * @property int $id
 * @property string $name
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\AssetStock[] $assetStocks
 * @property-read int|null $asset_stocks_count
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Asset[] $assets
 * @property-read int|null $assets_count
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetBrand newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetBrand newQuery()
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AssetBrand onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetBrand query()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetBrand whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetBrand whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetBrand whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetBrand whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AssetBrand whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AssetBrand withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\Models\AssetBrand withoutTrashed()
 * @mixin \Eloquent
 */
class AssetBrand extends Model
{
    use SoftDeletes, UsesTenantConnection;
    protected $hidden=['created_at', 'deleted_at', 'updated_at'];
    protected $guarded = [];

    public function assets()
    {
        return $this->hasMany(Asset::class, 'brand_id');
    }

    public function assetStocks()
    {
        return $this->hasMany(AssetStock::class, 'brand_id');
    }
}
